<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        [v-cloak] {
            display: none;
        }


    </style>
</head>
<body>
<div id="app">
    {{msg}}
    <br/>
    这是span
    <span v-text="msg"></span>
    <br/>
    <input type="button" v-bind:title="myTitle+ '这是字符串'" @click="show" value="保存"/>

    <!--    简写-->
    <div :title="myTitle + '标题'">测试v-bind的简写</div>
    <br/>
    v-model:
    <input type="text" v-model="msg"></input>
    <br/>
    插件表达式：插件表达式也不能双向绑定
    <br/>
    <button @click.once="onesClick">只触发一次</button>
</div>
<div id="app2">
    <h3 v-cloak>---{{msg}}-----</h3>
    <h3 v-text="msg"></h3>
    {{msg1}}
    <div v-html="msg1"></div>
</div>
<script src="../vuedemo/lib/vue.js"></script>
<script>
    var vue = new Vue({
        el: '#app',
        data: {
            msg: '这是vue中的msg',
            myTitle: '这是标题',
            count: 1
        },
        methods: {
            show: function (data) {
                console.log(data);
                this.msg = this.msg + this.count;
            },
            onesClick() {
                this.count++;
                alert(this.count)
            }
        }
    });
    var vm = new Vue({
        el: "#app2",
        data: {
            msg: "呵呵!!",
            msg1: "<h1>这是h1标题</h1>"
        }
    });
</script>
</body>
</html>
